package com.diipo.weibo.utils;

import java.io.ByteArrayOutputStream;
import java.io.InputStream;

public class StreamTool {
	public static byte [] readInputStream(InputStream inputStream)throws Exception{
		byte [] buffer = new byte[1024];
		int len = -1;
		ByteArrayOutputStream outStream = new ByteArrayOutputStream();
		while ((len = inputStream.read(buffer))!= -1) {
			outStream.write(buffer,0,len);
		}
		outStream.close();
		inputStream.close();
		return outStream.toByteArray();
	}
}
